#ifndef CONTROLLER_H
#define CONTROLLER_H


#include <QObject>
#include <QDebug>
#include <QTimer>
#include <QDesktopServices>
#include "../json/json.h"
//#include "systray.h"
#include "model.h"
#include "systray.h"
#include "ruleswindow.h"
#include "addruledialog.h"
#include "settingsdialog.h"


using namespace Json;

class Controller : public QObject
{
	Q_OBJECT

	public:
		Controller();
		void init();
	public slots:
	private:
		Model *model;
		Systray *systray;
		RulesWindow *rulesWindow;
		AddRuleDialog *addRuleDialog;
		SettingsDialog *settingsDialog;
		void createSystrayActions();

	private slots:
		void handleSystrayAction(QString action);
		void retrieveAddRule();
		void retrieveSaveRule(Value rule,int ruleID);
		void giveRates();
		void retrieveDeleteRule(int ruleID);
		void retrieveEditRule(int ruleID);
		void rejectRuleDialog();
		void showSettings();
		void retrieveNewSettings(Value newSettings);


};
#endif
